package mlp;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;


public class Data {

	public ArrayList<Element> elementos;


	public Data (String path){
		elementos = new ArrayList<Element>();
		readFile(path);

	}


	private double[][] readFile(String path){
		double[][] retorno = null;
		try {
			ArrayList<double[]> listaTemp = new ArrayList();
			File file = new File(path);
			Scanner reader = new Scanner(file);

			Element ele;
			double[] input;
			double classe;
			while(reader.hasNextLine()){
				String[] line = reader.nextLine().split("\t");
				input = new double[line.length-1];
				for (int i = 0; i < line.length-1; i++) {
					input[i] = Double.valueOf(line[i]);
				}
				classe = Double.valueOf(line[line.length-1]);
				ele = new Element(input, classe);
				this.elementos.add(ele);
			}

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}

		return retorno;

	}



}
